import dataJson from './data.json'

export function hashCode(str: string): number {
    let hash:number = 0, i, chr;
    if (str.length === 0) return hash;
    //str = btoa(str)
    for (i = 0; i < str.length; i++) {
        chr   = str.charCodeAt(i);
        hash  = ((hash << 5) - hash) + chr;
        hash |= 0; // Convert to 32bit integer
    }
    return hash & 0x7FFFFFFF;
}


for (let key in dataJson){
    let set = new Set<number>()
    let a = dataJson[key]
    //@ts-ignore
    for( let item of dataJson[key]){
        //console.log(item)
        //console.log(item["身份证号"])
        let hash = hashCode(item["身份证号"] + item["姓名"])
        //console.log(hash)
        if( set.has(hash)){
            console.log("err")
            console.log(key)
            console.log(item)
        }
        else
            set.add(hash)
        //break
    }
}
